<div class="unloginpage">
  <div class="row">
  <div ng-class="{'col s12':mobile,'col s4 offset-s4':!mobile,'mb20':true}">
      <ul class="tabs" style="overflow: hidden;">
        <li class="tab col s6"><a class="active" href="#phoneReg">手机注册</a></li>
        <li class="tab col s6"><a href="#emailReg">邮箱注册</a></li>
      </ul>
    </div>
    <form id="phoneReg" ng-class="{'col s12':mobile,'col s4 offset-s4':!mobile}">
      <div class="row">
        <div class="input-field col s12">
          <input id="reg-email" type="email" ng-class="{'invalid':User.emailError,'validate':!User.emailError}" ng-model="User.email" ng-blur="User.checkPhone()">
          <label for="reg-email">手机号</label>
          <div class="red-text text-darken-2" ng-if="User.phoneError != ''" ng-bind="User.emailError"></div>
        </div>
      </div>   
      <div class="row">
        <div class="input-field col s6">
          <input id="reg-code" type="text" class="validate" ng-model="User.code">
          <label for="reg-code">验证码</label>
        </div>
        <div class="input-field  col s6">
          <label class="ui button hoverable" ng-show="!User.getCodeStuff" ng-click="User.getCode()">获取验证码</label>
          <label class="ui button" disabled ng-show="User.getCodeStuff">{{scond}}s后重试</label>
        </div>
      </div> 
      <div class="row">
        <div class="input-field col s12">
          <input id="reg-password" type="password" class="validate" ng-model="User.password">
          <label for="reg-password">密码</label>
        </div>
      </div>
      <div class="row">
        <div class="input-field col s12">
          <input id="reg-password-c" type="password" ng-class="{'invalid':User.passwordError,'validate':!User.passwordError}" ng-model="User.password2">
          <label for="reg-password-c">确认密码</label>
          <div class="red-text text-darken-2" ng-if="User.passwordError != ''" ng-bind="User.passwordError"></div>
        </div>
      </div>
      <div class="row">
        <div class="col s12">
          <a href="#!/login" class="right red-text text-darken-2 hover-underline">已有账号，立即登录</a>
        </div>
      </div>
      <div class="row">
        <button class="col s12 waves-effect waves-light btn red hoverable" ng-click="User.reg()">注册</button>
      </div>
    </form>
    <form id="emailReg" ng-class="{'col s12':mobile,'col s4 offset-s4':!mobile}">
      <div class="row">
        <div class="input-field col s12">
          <input id="reg-name" type="text" ng-class="{'invalid':User.nameError,'validate':!User.nameError}" ng-model="User.name" ng-blur="User.checkName()">
          <label for="reg-name">邮箱</label>
          <div class="red-text text-darken-2" ng-if="User.nameError != ''" ng-bind="User.nameError"></div>
        </div>
      </div>    
      <div class="row">
        <div class="input-field col s6">
          <input id="reg-code" type="text" class="validate" ng-model="User.code">
          <label for="reg-code">验证码</label>
        </div>
        <div class="input-field  col s6">
          <label class="ui button hoverable" ng-show="!User.getCodeStuff" ng-click="User.getCode()">获取验证码</label>
          <label class="ui button" disabled ng-show="User.getCodeStuff">{{scond}}s后重试</label>
        </div>
      </div> 
      <div class="row">
        <div class="input-field col s12">
          <input id="reg-password" type="password" class="validate" ng-model="User.password">
          <label for="reg-password">密码</label>
        </div>
      </div>
      <div class="row">
        <div class="input-field col s12">
          <input id="reg-password-c" type="password" ng-class="{'invalid':User.passwordError,'validate':!User.passwordError}" ng-model="User.password2">
          <label for="reg-password-c">确认密码</label>
          <div class="red-text text-darken-2" ng-if="User.passwordError != ''" ng-bind="User.passwordError"></div>
        </div>
      </div>
      <div class="row">
        <div class="col s12">
          <a href="#!/login" class="right red-text text-darken-2">已有账号，立即登录</a>
        </div>
      </div>
      <div class="row">
        <button class="col s12 waves-effect waves-light btn red hoverable" ng-click="User.reg()">注册</button>
      </div>
    </form>
  </div>
</div>